import * as Constant from '../constant'

const initialState = {
    isLogin: false,
    loading: false,
}

// 仓库管理员
let reducer = (state = initialState, action) => {
    switch(action.type) {
        // 登录
        case Constant.LOGIN:
            state.isLogin = true;
            return {...state}
        case Constant.LOGIN_LOADIG:
            state.loading = action.payload;
            return {...state}
        // 退出登录
        case Constant.LOGOUT:
            state.isLogin = false;
            return {...state}
        default:
            return state
    }
}
export default reducer